#include<iostream>
using namespace std;

int* reverse1(int* arr,int len) {
	int temp;
	for (int start = 0,end=len-1; start <=end; start++,end--)
	{
		temp = arr[start];
		arr[start] = arr[end];
		arr[end] = temp;
	}
	return arr;
}

int* reverse2(int* arr, int len) {
	int* temp = new int[len];
	for (int i = len-1; i >=0; i--)
	{
		temp[len - 1 - i] = arr[i];
	}
	return temp;
}
void main01() {
	int a[] = { 1,2,3,4 };
	int lena = sizeof(a) / sizeof(a[0]);
	int* res1=reverse1(a,lena);
	for (int i = 0; i < lena; i++)
	{
		cout << res1[i] << endl;
	}
	cout << "----------------------------" << endl;
	int b[] = { 1,2,3,5,6,7,8,9 };
	int lenb = sizeof(b) / sizeof(b[0]);
	int* res2 = reverse2(b, lenb);
	for (int i = 0; i < lenb; i++)
	{
		cout << res2[i] << endl;
	}

	
	
	

}